//实参个数和形参个数一致，方法返回值number
function foo(n:number, m?:string):number{
    return 123;
}

foo(123);
foo(123, '123');

//写法1
let foo1 = function(n:number, m?:string):number{
    return 123;
}

foo1(123);
foo1(123, '123');

//写法2
let foo2:(n:number, m?:string) => number = function(n:number, m?:string):number{
    return 123;
}

foo2(123);
foo2(123, '123');

//写法3
let foo3:(n:number, m?:string) => number = function(n, m?){
    return 123;
}

foo3(123);
foo3(123, '123');

//void
let zoo1 = function(){

}

//可以不return。也可以return undefined
let zoo2 = function(): void{
    //return ;
}

let zoo3 = function(): undefined{
}
